package com.itheima.thread;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

public class Demo05 {

    public static void main(String[] args) {
        new Thread(new FutureTask<>(new Callable<String>() {
            @Override
            public String call() throws Exception {
                for (int i = 0; i < 100; i++) {
                    System.out.println("Callable的匿名内部类执行到了"+i);
                }
                return null;
            }
        })).start();
        new Thread(new FutureTask<>(()->{
            for (int i = 0; i < 100; i++) {
                System.out.println("Callable的lambda表达式执行到了"+i);
            }
        return  "";
        })).start();


    }
}
